Skip to content

Only wait for JavaScript that is running ~now#985

Merged
timja merged 7 commits intojenkinsci:masterfrom
timja:speed-up-htmlunit
Aug 22, 2025
Merged

Only wait for JavaScript that is running ~now#985
timja merged 7 commits intojenkinsci:masterfrom
timja:speed-up-htmlunit

Conversation

@timja
Copy link
Copy Markdown
Member

@timja timja commented Jun 22, 2025

Avoids sitting and waiting for 10s on pages that constantly run JavaScript, e.g. widgets.

Fixes #946

Testing done

Ran hudson.model.DirectoryBrowserSupportTest#symlink_outsideWorkspace_areNotAllowed

Went from 38s to 8s

Tested incremental on a core build - jenkinsci/jenkins#10764 - Save an hour or so of test execution time.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@timja timja changed the title Don't wait for timeout when javascript is always running Only wait for JavaScript that is running ~now Aug 21, 2025
@timja timja marked this pull request as ready for review August 21, 2025 21:24
@timja timja requested a review from a team August 21, 2025 21:24
Copy link
Copy Markdown
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@MarkEWaite
Copy link
Copy Markdown
Contributor

I see in the Javadoc that there is a warning:

Experimental API: May be changed in next release and may not yet work perfectly!

I think that is a risk worth accepting in this case. If the API changes significantly in the future, we can always fall back to the previous implementation.

@timja
Copy link
Copy Markdown
Member Author

timja commented Aug 22, 2025

The API was created for us anyway and we call other HTMLUnit APIs like this IIRC.

@timja timja merged commit 429405e into jenkinsci:master Aug 22, 2025
15 checks passed
@timja timja deleted the speed-up-htmlunit branch August 22, 2025 08:06
@rbri
Copy link
Copy Markdown

rbri commented Aug 22, 2025

@MarkEWaite, @timja lets do it the other way around, will improve the docu a bit and remove the experimental flag. As it seems to work it should not be experimetal any longer.

@rbri
Copy link
Copy Markdown

rbri commented Aug 29, 2025

@MarkEWaite, @timja 4.16.0 is out, the methods are no longer experimental

@MarkEWaite
Copy link
Copy Markdown
Contributor

@MarkEWaite, @timja 4.16.0 is out, the methods are no longer experimental

Thanks! The 4.16.0 release has been merged into Jenkins test harness htmlunit with:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebClient.goTo requests cause 10s wasted delay for each call

3 participants